package com.xuxin.queue.network;

import com.xuxin.queue.bean.BaseBean;
import com.xuxin.queue.bean.PlayerBean;
import com.xuxin.queue.bean.QueueBean;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;

/**
 * Created by xu_xin
 * Created on 2020.06.05
 */
public interface RetrofitApi {


    @GET("getData")
    Observable<BaseBean> getData(@Header("token") String token,
                                 @Query("user") String user,
                                 @Query("password") String password);

    @FormUrlEncoded
    @POST("getData")
    Observable<BaseBean> getData(@Header("token") String token,
                                 @Query("user") String user,
                                 @Query("password") String password,
                                 @Field("id") String id);

    @POST("getData")
    Observable<BaseBean> getData(@Header("token") String token,
                                 @Query("user") String user,
                                 @Query("password") String password,
                                 @Body RequestBody requestBody);

    @POST()
    Observable<QueueBean> getQueuingInfo(@Url String url);

    @GET()
    Observable<PlayerBean> getPlayer(@Url String url);
}